** Appendix Figure E.3

use "$project_path/data/4_regdata/dynamics/regdata_dynamics", clear

gen diff_m1_exec_approval = .
replace diff_m1_exec_approval = diff_m1_approval_HOS if elected_leader=="HOS"
replace diff_m1_exec_approval = diff_m1_approval_HOG if elected_leader=="HOG"

local nb_rows = 7
matrix res_mat = J(`nb_rows',3,.)
matrix coln res_mat = tau ci_low ci_high
local laglabels = "Placebo 0 1 2 3 4 5"
matrix rown res_mat = `laglabels'
local temp_row = 0
foreach relative_year in -2 0 1 2 3 4 5 {
	local temp_row = `temp_row'+1
	rdrobust diff_m1_exec_approval runvar if relative_year==`relative_year', level(90) all
	matrix res_mat[`temp_row',1] = `e(tau_cl)'
	matrix res_mat[`temp_row',2] = `e(ci_l_rb)'
	matrix res_mat[`temp_row',3] = `e(ci_r_rb)'
}

coefplot (matrix(res_mat[.,1]), ci((res_mat[.,2] res_mat[.,3])) offset(0) color(midblue) ciopts(lwidth(*3) lcolor(midblue) )) , yline(0) xline(1.5, lwidth(thick) lcolor(black%30)) vertical title("", size(vlarge)) xlabel(,labsize(large)) ylabel(-10(5)25,labsize(large) angle(0)) xtitle("Years after the election", size(large)) graphregion(color(white)) legend(off) ytitle("Percentage points", size(large))
graph export "$project_path/output/appendix_figures/Appendix_Figure_E3.pdf", as(pdf) name("Graph") replace
